package cn.dnuifood_cjy.dnuifood_16110100529.model;

import cn.dnuifood_cjy.dnuifood_16110100529.iface.FoodIface;
import cn.dnuifood_cjy.dnuifood_16110100529.listener.OnRetrofitListener;
import cn.dnuifood_cjy.dnuifood_16110100529.service.ShopService;
import retrofit2.Call;

public class FoodModel extends RetrofitBaseModel implements FoodIface {
    private ShopService service;
    public FoodModel(){
        super();
        service = retrofit.create(ShopService.class);
    }
    @Override
    public void getFoodByShop(String shop_id, OnRetrofitListener listener) {
        Call call = service.getFoodByShop(shop_id);
        bindCallback(call,listener,3);
    }

    @Override
    public void getFoodById(String food_id, OnRetrofitListener listener) {
        Call call = service.getFoodById(food_id);
        bindCallback(call,listener,4);
    }

    @Override
    public void getFoodBySearch(String search, OnRetrofitListener listener) {
        Call call = service.getFoodBySearch(search);
        bindCallback(call,listener,5);
    }
}